<!DOCTYPE html>
<html lang="en">


<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <block name="style">
        <link rel="stylesheet" href="__MYCSS__/main.min.css">
    </block>
</head>
<extend name="Public/base" />
<block name="body">

    <body>
        <ol class="breadcrumb">
            <li><a href="#">财务管理</a></li>
            <li class="active">客户（收入）需求表</li>
        </ol>
        <p>
            <a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="false" aria-controls="collapseExample">查询</a>
            <button type="button" class="btn btn-default" data-toggle="modal" data-target="#addModal">添加</button>
        </p>
        <div class="collapse" id="collapseExample">
            <div class="well">
                <form method="GET" action="{:U('lst')}">
                    <div class="row">
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label for="khmc">客户名称：</label>
                                <select class="form-control " name="khmc">
                                    <option value="">--请选择--</option>
                                    <volist name="khmc_arr" id="khmc">
                                        <option value="{$khmc}">{$khmc}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label for="ywbk">业务版块：</label>
                                <select class="form-control " name="ywbk">
                                    <option value="">--请选择--</option>
                                    <volist name="ywbk_arr" id="ywbk">
                                        <option value="{$ywbk}">{$ywbk}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label for="ywqy">业务区域：</label>
                                <select class="form-control " name="ywqy">
                                    <option value="">--请选择--</option>
                                    <volist name="ywqy_arr" id="ywqy">
                                        <option value="{$ywqy}">{$ywqy}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label for="htbh">合同编号：</label>
                                <select class="form-control " name="htbh">
                                    <option value="">--请选择--</option>
                                    <volist name="htbh_arr" id="htbh">
                                        <option value="{$htbh}">{$htbh}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-3">
                            <div class="form-group">
                                <label for="dynbgs">对应内部公司：</label>
                                <select class="form-control " name="dynbgs">
                                    <option value="">--请选择--</option>
                                    <volist name="dynbgs_arr" id="dynbgs">
                                        <option value="{$dynbgs}">{$dynbgs}</option>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="form-group">
                                <label for="year">所属年份：</label>
                                <select class="form-control father_select year_select" name="year">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="form-group">
                                <label for="month">所属月份：</label>
                                <select class="form-control son_select month_select" name="month" disabled="disabled">
                                    <option value="">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-lg-3">
                            <div class="form-group" style="margin-top: 24px;">
                                <button type="submit" class="btn btn-success">查询</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>


        <div class="panel panel-default">
            <div class="panel-heading">客户（收入）需求表</div>
            <div class="surface_table">
                <div class="table-head">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="table-h">
                                <th>录入日期</th>
                                <th>所属月份</th>
                                <th>业务区域</th>
                                <th>业务板块</th>
                                <th>运营商类型</th>
                                <th>客户名称</th>
                                <th>对应公司名称</th>
                                <th>合同编号</th>
                                <th>是否需要开票</th>
                                <th>应收</th>
                                <th>应收调整</th>
                                <th>调整日期</th>
                                <th>调整原因</th>
                                <th>调整后应收</th>
                                <th>调整后应收占比</th>
                                <th>实收</th>
                                <th>收款日期</th>
                                <th>开票金额</th>
                                <th>开票日期</th>
                                <th>应收未收</th>
                                <th>应收未收占比</th>
                                <th>未开发票</th>
                                <th>合同约定账龄</th>
                                <th>账龄预警值</th>
                                <th>超账龄预警金额</th>
                                <th>3个月内应收未收额</th>
                                <th>3-6个月应收未收额</th>
                                <th>6个月以上应收未收额</th>
                                <th>特别说明</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                    </table>
                </div>
                <div class="table-body">
                    <table class="table table-hover table-bordered">
                        <tbody>
                            <volist name="lsts" id="list">
                                <tr>
                                    <td>{$list.updatetime}</td>
                                    <td>{$list.yf}</td>
                                    <td>{$list.ywqy}</td>
                                    <td>{$list.ywbk}</td>
                                    <td>{$list.yyslx}</td>
                                    <td>{$list.khmc}</td>
                                    <td>{$list.dynbgs}</td>
                                    <td>{$list.htbh}</td>
                                    <td>{$list.kp}</td>
                                    <td class="count_ys">{$list.ys}</td>
                                    <td class="count_tz">{$list.tz}</td>
                                    <td>{$list.tzrq}</td>
                                    <td>{$list.tzyy}</td>
                                    <td class="count_tzys">{$list.tzys}</td>
                                    <td>{$list.tzyszb}</td>
                                    <td class="count_ss">{$list.ss}</td>
                                    <td>{$list.skrq}</td>
                                    <td>{$list.kpje}</td>
                                    <td>{$list.kprq}</td>
                                    <td class="count_ysws">{$list.ysws}</td>
                                    <td>{$list.yswszb}</td>
                                    <td class="count_fp">{$list.fp}</td>
                                    <td>{$list.zl}</td>
                                    <td>{$list.zlyjz}</td>
                                    <td style="min-width:160px">{$list.zlyjje}</td>
                                    <td style="min-width:160px">{$list.yfwfe3}</td>
                                    <td style="min-width:160px">{$list.yfwfe36}</td>
                                    <td style="min-width:160px">{$list.yfwfe6}</td>
                                    <td>{$list.tbsm}</td>
                                    <td>
                                        <button type="button" data-id="{$list.id}" class="btn btn-warning update_btn" data-toggle="modal" data-target="#updateModal">修改</button>
                                        <a class="btn btn-danger delete_btn" href="{:U('del',array('id'=>$list['id']))}" role="button">删除</a>
                                    </td>
                                </tr>
                            </volist>
                            <tr>
                                <td colspan="9" style="text-align: center">总计</td>
                                <td id="count_ys" class="count"></td>
                                <td id="count_tz" class="count"></td>
                                <td olspan="2"></td>
                                <td></td>
                                <td id="count_tzys" class="count"></td>
                                <td></td>
                                <td id="count_ss" class="count"></td>
                                <td></td>
                                <td id="count_ysws" class="count"></td>
                                <td></td>
                                <td id="count_fp" class="count"></td>
                                <td colspan="11"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!--添加面板-->
        <div class="modal fade bs-example-modal-lg" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">增加客户（收入）需求表</h4>
                    </div>
                    <div class="modal-body">
                        <form id="khzyForm" class="public_form" action="{:U('add')}" method="post">
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addsssj">所属时间</label>
                                        <input type="text" class="form-control form_date" value="" id="addsssj" name="sssj" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addhtbh">合同编号</label>
                                        <input type="text" class="form-control" id="addhtbh" name="htbh">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addywqy">业务区域</label>
                                        <input type="text" class="form-control" id="addywqy" name="ywqy">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="adddynbgs">对应内部公司</label>
                                        <input type="text" class="form-control" id="adddynbgs" name="dynbgs">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addywbk">业务板块</label>
                                        <input type="text" class="form-control" id="addywbk" name="ywbk">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyyslx">运营商类型</label>
                                        <input type="text" class="form-control" id="addyyslx" name="yyslx">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="khmc">客户名称</label>
                                        <input type="text" class="form-control" id="addkhmc" name="khmc">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="kp">是否开票：</label>
                                        <div>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" id="addkp" value="是" checked> 是
                                        </label>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" id="addkp" value="否"> 否
                                        </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addys">应收</label>
                                        <input type="text" class="form-control" id="addys" name="ys">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtz">应收调整</label>
                                        <input type="text" class="form-control" id="addtz" name="tz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtzrq">调整时间</label>
                                        <input type="text" class="form-control form_date" value="" id="addsssj" name="tzrq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtzyy">调整原因</label>
                                        <input type="text" class="form-control" id="addtzyy" name="tzyy">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addss">实收</label>
                                        <input type="text" class="form-control" id="addss" name="ss">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addskrq">收款日期</label>
                                        <input type="text" class="form-control form_date" value="" id="addskrq" name="skrq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addkpje">开票金额</label>
                                        <input type="text" class="form-control" id="addkpje" name="kpje">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addkprq">开票日期</label>
                                        <input type="text" class="form-control form_date" value="" id="addkprq" name="kprq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addfb">未开发票</label>
                                        <input type="text" class="form-control" id="addfb" name="fb">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzl">合同约定账龄</label>
                                        <input type="text" class="form-control" id="addzl" name="zl">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzlyjz">账龄预警值</label>
                                        <input type="text" class="form-control" id="addzlyjz" name="zlyjz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addzlyjje">超账龄预警金额</label>
                                        <input type="text" class="form-control" id="addzlyjje" name="zlyjje">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe3">3个月内应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe3" name="yfwfe3">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe6">6个月以上应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe6" name="yfwfe6">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addyfwfe36">3-6个月应收未收额</label>
                                        <input type="text" class="form-control" id="addyfwfe36" name="yfwfe36">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="addtbsm">特别说明</label>
                                        <input type="text" class="form-control" id="addtbsm" name="tbsm">
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary">保存表单</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
        <!--修改面板-->
        <div class="modal fade bs-example-modal-lg" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">修改客户（收入）需求表</h4>
                    </div>
                    <div class="modal-body">
                        <form id="khzyForm" class="public_form update_form" action="{:U('edit')}" method="post">
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatesssj">所属月份</label>
                                        <input type="text" class="form-control form_date" value="" id="updatesssj" name="sssj" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatehtbh">合同编号</label>
                                        <input type="text" class="form-control" id="updatehtbh" name="htbh">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateywqy">业务区域</label>
                                        <input type="text" class="form-control" id="updateywqy" name="ywqy">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatedynbgs">对应内部公司</label>
                                        <input type="text" class="form-control" id="updatedynbgs" name="dynbgs">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateywbk">业务板块</label>
                                        <input type="text" class="form-control" id="updateywbk" name="ywbk">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyyslx">运营商类型</label>
                                        <input type="text" class="form-control" id="updateyyslx" name="yyslx">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="khmc">客户名称</label>
                                        <input type="text" class="form-control" id="updatekhmc" name="khmc">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="kp">是否开票：</label>
                                        <div>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" id="updatekp" value="是" checked> 是
                                        </label>
                                            <label class="checkbox-inline">
                                            <input type="radio" name="kp" id="updatekp" value="否"> 否
                                        </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateys">应收</label>
                                        <input type="text" class="form-control" id="updateys" name="ys">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetz">应收调整</label>
                                        <input type="text" class="form-control" id="updatetz" name="tz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetzrq">调整时间</label>
                                        <input type="text" class="form-control form_date" value="" id="updatetzrq" name="tzrq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetzyy">调整原因</label>
                                        <input type="text" class="form-control" id="updatetzyy" name="tzyy">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatess">实收</label>
                                        <input type="text" class="form-control" id="updatess" name="ss">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateskrq">收款日期</label>
                                        <input type="text" class="form-control form_date" value="" id="updateskrq" name="skrq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatekpje">开票金额</label>
                                        <input type="text" class="form-control" id="updatekpje" name="kpje">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatekprq">开票日期</label>
                                        <input type="text" class="form-control form_date" value="" id="updatekprq" name="kprq" data-date-format="yyyy-mm-dd">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatefp">未开发票</label>
                                        <input type="text" class="form-control" id="updatefp" name="fp">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezl">合同约定账龄</label>
                                        <input type="text" class="form-control" id="updatezl" name="zl">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezlyjz">账龄预警值</label>
                                        <input type="text" class="form-control" id="updatezlyjz" name="zlyjz">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatezlyjje">超账龄预警金额</label>
                                        <input type="text" class="form-control" id="updatezlyjje" name="zlyjje">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe3">3个月内应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe3" name="yfwfe3">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe6">6个月以上应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe6" name="yfwfe6">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updateyfwfe36">3-6个月应收未收额</label>
                                        <input type="text" class="form-control" id="updateyfwfe36" name="yfwfe36">
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="updatetbsm">特别说明</label>
                                        <input type="text" class="form-control" id="updatetbsm" name="tbsm">
                                    </div>
                                </div>
                            </div>
                            <input type="hidden" id="update_id" name="id">
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                <button type="submit" class="btn btn-primary">保存表单</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <script src="__MYJS__/main.min.js"></script>
            <script src="__MYJS__/main.js"></script>
            <script src="__MYJS__/validator.js"></script>
            <script src="__MYJS__/table.js"></script>
            <script>
                (function () {
                    // 修改按钮事件
                    $("table").on("click", ".update_btn", function (e) {
                        e.stopPropagation();
                        var id = $(this).attr("data-id");
                        $.ajax({
                            url: "{:U('edit')}",
                            type: 'GET', //GET
                            data: {
                                id: id
                            },
                            success: function (data) {
                                $(".update_form .form-control").each(function (index, val) {
                                    var self = this;
                                    for (x in data) {
                                        if ($(self).attr("name") == x) {
                                            if (x == "kp" && $(self).attr("name") == x) {
                                                $(":radio[name='" + x + "'][value='" +
                                                    data[x] +
                                                    "']").prop("checked", "checked");
                                            } else {
                                                $(self).val(data[x]);
                                            }
                                        }
                                    }
                                });
                                // 重新更新日期选择器
                                $(".update_form .form_date").each(function (index, val) {
                                    if ($(this).val() != "") {
                                        $(this).val(moment($(this).val(),
                                            "YYYYMMDD").format(
                                            "YYYY-MM-DD"))
                                    }
                                })
                                $(".update_form .form_date").datetimepicker('update');
                            }
                        })
                        $("#update_id").val(id);
                        $('#updateModal').modal("show")
                    })
                    var zdytable = new window.zdytable();
                })()
            </script>

            <script>
            </script>
    </body>
</block>

</html>